# -*- coding: utf-8 -*-


import os
import uuid
import django
from datetime import datetime
from core.initialize import Initialize
from apps.sys.models import Menu, DictType, DictData

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "application.settings")
django.setup()


class Init(Initialize):

    def init_dict(self):
        dict_type = [
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "主机类型",
                "type": "oms_host_type",
                "remark": "",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "主机状态",
                "type": "oms_host_status",
                "remark": "",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "操作系统",
                "type": "oms_oper_system",
                "remark": "",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "鹰眼日志状态",
                "type": "oms_hawkeye_stutas",
                "remark": "",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "鹰眼日志分析结论",
                "type": "oms_hawkeye_analysis",
                "remark": "",
            },
        ]
        dict_data = [
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "default": True,
                "id": uuid.uuid4(),
                "type": "oms_host_type",
                "sort": 1,
                "label": "Dut(被测件)",
                "value": "0",
                "tagType": "default",
                "tagClass": "",
                "remark": "",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "default": True,
                "id": uuid.uuid4(),
                "type": "oms_host_type",
                "sort": 2,
                "label": "PC(客户端)",
                "value": "1",
                "tagType": "default",
                "tagClass": "",
                "remark": "",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "default": True,
                "id": uuid.uuid4(),
                "type": "oms_host_type",
                "sort": 3,
                "label": "PServer(服务器)",
                "value": "2",
                "tagType": "default",
                "tagClass": "",
                "remark": "",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "default": True,
                "id": uuid.uuid4(),
                "type": "oms_host_type",
                "sort": 4,
                "label": "Switch(交换机)",
                "value": "3",
                "tagType": "default",
                "tagClass": "",
                "remark": "",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "default": True,
                "id": uuid.uuid4(),
                "type": "oms_host_type",
                "sort": 5,
                "label": "Router(路由器)",
                "value": "4",
                "tagType": "default",
                "tagClass": "",
                "remark": "",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "default": True,
                "id": uuid.uuid4(),
                "type": "oms_host_type",
                "sort": 6,
                "label": "Tester(测试仪)",
                "value": "5",
                "tagType": "default",
                "tagClass": "",
                "remark": "",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "default": True,
                "id": uuid.uuid4(),
                "type": "oms_host_status",
                "sort": 1,
                "label": "空闲",
                "value": "0",
                "tagType": "success",
                "tagClass": "",
                "remark": "",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "default": True,
                "id": uuid.uuid4(),
                "type": "oms_host_status",
                "sort": 2,
                "label": "占用",
                "value": "1",
                "tagType": "danger",
                "tagClass": "",
                "remark": "",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "default": True,
                "id": uuid.uuid4(),
                "type": "oms_host_status",
                "sort": 3,
                "label": "故障",
                "value": "2",
                "tagType": "warning",
                "tagClass": "",
                "remark": "",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "default": True,
                "id": uuid.uuid4(),
                "type": "oms_oper_system",
                "sort": 1,
                "label": "Linux",
                "value": "0",
                "tagType": "default",
                "tagClass": "",
                "remark": "Linux",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "default": True,
                "id": uuid.uuid4(),
                "type": "oms_oper_system",
                "sort": 2,
                "label": "Windows",
                "value": "1",
                "tagType": "default",
                "tagClass": "",
                "remark": "Windwos",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "default": True,
                "id": uuid.uuid4(),
                "type": "oms_oper_system",
                "sort": 3,
                "label": "Mac OS",
                "value": "2",
                "tagType": "default",
                "tagClass": "",
                "remark": "Mac OS",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "default": True,
                "id": uuid.uuid4(),
                "type": "oms_oper_system",
                "sort": 4,
                "label": "其他",
                "value": "3",
                "tagType": "default",
                "tagClass": "",
                "remark": "其他",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "default": True,
                "id": uuid.uuid4(),
                "type": "oms_hawkeye_status",
                "sort": 1,
                "label": "待分析",
                "value": "0",
                "tagType": "error",
                "tagClass": "",
                "remark": "待分析",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "default": True,
                "id": uuid.uuid4(),
                "type": "oms_hawkeye_status",
                "sort": 2,
                "label": "已分析",
                "value": "1",
                "tagType": "success",
                "tagClass": "",
                "remark": "已分析",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "default": True,
                "id": uuid.uuid4(),
                "type": "oms_hawkeye_analysis",
                "sort": 1,
                "label": "非问题",
                "value": "0",
                "tagType": "default",
                "tagClass": "",
                "remark": "非问题",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "default": True,
                "id": uuid.uuid4(),
                "type": "oms_hawkeye_analysis",
                "sort": 2,
                "label": "版本问题",
                "value": "1",
                "tagType": "error",
                "tagClass": "",
                "remark": "版本问题",
            },
        ]
        self.save(DictType, dict_type, "字典类型")
        self.save(DictData, dict_data, "字典数据")

    def init_menu(self):
        """
        初始化菜单表-运维管理
        """
        oms = uuid.uuid4()
        oms_env = uuid.uuid4()
        oms_host = uuid.uuid4()
        oms_hawkeye = uuid.uuid4()
        oms_node = uuid.uuid4()
        self.menu_oms_data = [
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": oms,
                "name": "运维管理",
                "type": "M",
                "icon": "operation",
                "path": "/oms",
                "component": "Layout",
                "perms": None,
                "nesting": True,
                "redirect": "noRedirect",
                "parent_id": None,
                "sort": 4,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": oms_env,
                "name": "环境管理",
                "type": "C",
                "icon": "env",
                "path": "env",
                "component": "oms/env/index",
                "perms": "oms:env:list",
                "parent_id": oms,
                "sort": 1,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "环境查询",
                "type": "F",
                "icon": "#",
                "perms": "oms:env:query",
                "parent_id": oms_env,
                "sort": 1,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "环境新增",
                "type": "F",
                "icon": "#",
                "perms": "oms:env:add",
                "parent_id": oms_env,
                "sort": 2,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "环境修改",
                "type": "F",
                "icon": "#",
                "perms": "oms:env:edit",
                "parent_id": oms_env,
                "sort": 3,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "环境删除",
                "type": "F",
                "icon": "#",
                "perms": "oms:env:delete",
                "parent_id": oms_env,
                "sort": 4,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "环境导入",
                "type": "F",
                "icon": "#",
                "perms": "oms:env:import",
                "parent_id": oms_env,
                "sort": 5,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "环境导出",
                "type": "F",
                "icon": "#",
                "perms": "oms:env:export",
                "parent_id": oms_env,
                "sort": 6,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "添加主机",
                "type": "F",
                "icon": "#",
                "perms": "oms:env:addHost",
                "parent_id": oms_env,
                "sort": 7,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": oms_host,
                "name": "主机管理",
                "type": "C",
                "icon": "host",
                "path": "host",
                "component": "oms/host/index",
                "perms": "oms:host:list",
                "parent_id": oms,
                "sort": 1,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "主机查询",
                "type": "F",
                "icon": "#",
                "perms": "oms:host:query",
                "parent_id": oms_host,
                "sort": 1,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "主机新增",
                "type": "F",
                "icon": "#",
                "perms": "oms:host:add",
                "parent_id": oms_host,
                "sort": 2,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "主机修改",
                "type": "F",
                "icon": "#",
                "perms": "oms:host:edit",
                "parent_id": oms_host,
                "sort": 3,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "主机删除",
                "type": "F",
                "icon": "#",
                "perms": "oms:host:delete",
                "parent_id": oms_host,
                "sort": 4,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "主机导入",
                "type": "F",
                "icon": "#",
                "perms": "oms:host:import",
                "parent_id": oms_host,
                "sort": 5,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "主机导出",
                "type": "F",
                "icon": "#",
                "perms": "oms:host:export",
                "parent_id": oms_host,
                "sort": 6,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": oms_node,
                "name": "节点管理",
                "type": "C",
                "icon": "node",
                "path": "node",
                "component": "oms/node/index",
                "perms": "oms:node:list",
                "parent_id": oms,
                "sort": 1,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "节点查询",
                "type": "F",
                "icon": "#",
                "perms": "oms:node:query",
                "parent_id": oms_node,
                "sort": 1,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "节点新增",
                "type": "F",
                "icon": "#",
                "perms": "oms:node:add",
                "parent_id": oms_node,
                "sort": 2,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "节点修改",
                "type": "F",
                "icon": "#",
                "perms": "oms:node:edit",
                "parent_id": oms_node,
                "sort": 3,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "节点删除",
                "type": "F",
                "icon": "#",
                "perms": "oms:node:delete",
                "parent_id": oms_node,
                "sort": 4,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "节点导入",
                "type": "F",
                "icon": "#",
                "perms": "oms:node:import",
                "parent_id": oms_node,
                "sort": 5,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "节点导出",
                "type": "F",
                "icon": "#",
                "perms": "oms:node:export",
                "parent_id": oms_node,
                "sort": 6,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": oms_hawkeye,
                "name": "鹰眼监控",
                "type": "C",
                "icon": "hawkeye",
                "path": "hawkeye",
                "component": "oms/hawkeye/index",
                "perms": "oms:hawkeye:list",
                "parent_id": oms,
                "sort": 3,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "日志查询",
                "type": "F",
                "icon": "#",
                "perms": "oms:hawkeye:query",
                "parent_id": oms_hawkeye,
                "sort": 1,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "日志新增",
                "type": "F",
                "icon": "#",
                "perms": "oms:hawkeye:add",
                "parent_id": oms_hawkeye,
                "sort": 2,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "日志修改",
                "type": "F",
                "icon": "#",
                "perms": "oms:hawkeye:edit",
                "parent_id": oms_hawkeye,
                "sort": 3,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "日志删除",
                "type": "F",
                "icon": "#",
                "perms": "oms:hawkeye:delete",
                "parent_id": oms_hawkeye,
                "sort": 4,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "日志导入",
                "type": "F",
                "icon": "#",
                "perms": "oms:hawkeye:import",
                "parent_id": oms_hawkeye,
                "sort": 5,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "日志导出",
                "type": "F",
                "icon": "#",
                "perms": "oms:hawkeye:export",
                "parent_id": oms_hawkeye,
                "sort": 6,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "日志分析",
                "type": "F",
                "icon": "#",
                "perms": "oms:hawkeye:analysis",
                "parent_id": oms_hawkeye,
                "sort": 7,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "任务查询",
                "type": "F",
                "icon": "#",
                "perms": "oms:job:query",
                "parent_id": oms_hawkeye,
                "sort": 8,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "任务新增",
                "type": "F",
                "icon": "#",
                "perms": "oms:job:add",
                "parent_id": oms_hawkeye,
                "sort": 9,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "任务修改",
                "type": "F",
                "icon": "#",
                "perms": "oms:job:edit",
                "parent_id": oms_hawkeye,
                "sort": 10,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "任务删除",
                "type": "F",
                "icon": "#",
                "perms": "oms:job:delete",
                "parent_id": oms_hawkeye,
                "sort": 11,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "任务导入",
                "type": "F",
                "icon": "#",
                "perms": "oms:job:import",
                "parent_id": oms_hawkeye,
                "sort": 12,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "任务导出",
                "type": "F",
                "icon": "#",
                "perms": "oms:job:export",
                "parent_id": oms_hawkeye,
                "sort": 13,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "任务执行",
                "type": "F",
                "icon": "#",
                "perms": "oms:job:start",
                "parent_id": oms_hawkeye,
                "sort": 14,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "任务停止",
                "type": "F",
                "icon": "#",
                "perms": "oms:job:stop",
                "parent_id": oms_hawkeye,
                "sort": 15,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "任务暂停",
                "type": "F",
                "icon": "#",
                "perms": "oms:job:pause",
                "parent_id": oms_hawkeye,
                "sort": 16,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "任务恢复",
                "type": "F",
                "icon": "#",
                "perms": "oms:job:resume",
                "parent_id": oms_hawkeye,
                "sort": 17,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "执行日志",
                "type": "F",
                "icon": "#",
                "perms": "oms:job:log",
                "parent_id": oms_hawkeye,
                "sort": 18,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "插件预览",
                "type": "F",
                "icon": "#",
                "perms": "oms:jobPlugins:view",
                "parent_id": oms_hawkeye,
                "sort": 19,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "插件上传",
                "type": "F",
                "icon": "#",
                "perms": "oms:jobPlugins:upload",
                "parent_id": oms_hawkeye,
                "sort": 20,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "插件下载",
                "type": "F",
                "icon": "#",
                "perms": "oms:jobPlugins:download",
                "parent_id": oms_hawkeye,
                "sort": 21,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "插件删除",
                "type": "F",
                "icon": "#",
                "perms": "oms:jobPlugins:delete",
                "parent_id": oms_hawkeye,
                "sort": 22,
            },
        ]
        self.save(Menu, self.menu_oms_data, "菜单表")

    def run(self):
        self.init_dict()
        self.init_menu()


def main(reset=False):
    Init(reset).run()
    pass


if __name__ == "__main__":
    main()
